<template>
	<div class="toggleComponents">
		<img src="../../assets/newEnergyShip/切换icon.png"  @click="toggle" />
	</div>
</template>
<script>
export default {
	name: 'toggleComponents',
	data() {
		return {};
	},
	props: {
		components: {
			type: Array,
			default: function () {
				return [];
			}
		}
	},
	methods: {
		// 组件切换
		toggle() {
			this.components.forEach((i) => (i.isActive = !i.isActive));
		}
	}
};
</script>
<style lang="scss" scoped>
.toggleComponents {
	width: 100%;
	text-align: right;
  flex: 1;
	img {
		width: 14px;
		height: 14px;
		cursor: pointer;
	}
}
</style>
